<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 100px;
            height: 100px;
            background-color: red;
            transition: all 4s;
        }
        /* .big{
            width: 500px;
            height: 500px;
            background-color: yellow;
            transition: all 1s;
        } */
        .big{
            background-color: yellow;
            /* transition: all 1s; */
        }
    </style>
</head>
<body>
    <div class="box" data-tilte="123"></div>
</body>
<script>
    window.onload = function() {
        var box =  document.querySelector('.box')
        console.log(box.getAttribute('data-tilte'));
        var el = document.createElement('div')
        el.innerHTML = '<p>123</p>'
        box.appendChild(el)
        box.onclick =() =>{
            console.log(box.className);
            if(box.className == 'box') {
            box.className = 'box big ';
        }else{
            box.className = 'box';
        }
    }
    }
</script>
</html>